// JavaScript Document
$(document).ready(function(e) {
    $('#button-yes').click(function(e) {
        hideConfirmAlert();
    });
	
	adjustSize();
});

function showAlert(title, message, idFocus){	
	$('#positive-button').attr('focusid', idFocus);
	$('#window-title').text(title);
	$('#window-message').text(message);
	$('#alert-dialog').show();
}

function hideAlert(){
	var idFocus = $('#positive-button').attr('focusid');
	$('#alert-dialog').hide();
	if(idFocus != '')
		$('#'+idFocus).focus();
}

function showConfirm(title, message, yesFunc){
	yesFunc = yesFunc.replace(/\[/g,"'");
	yesFunc = yesFunc.replace(/\]/g,"'");
	$('#button-yes').attr('onclick', yesFunc);
	$('#confrim-window-title').text(title);
	$('#confrim-window-message').text(message);
	$('#confirm-dialog').show();
}

function hideConfirmAlert(){
	$('#confirm-dialog').hide();
}

function checkEmailAddr(email){
	var pattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}(\.[a-zA-Z]{2,3}){0,1}$/;
	return pattern.test(email);
}

function adjustSize(){
	$(document).ready(function(e) {
		$('.left').removeAttr('style');
		$('.right').removeAttr('style');
        var rightheight = $('.right').height();
		var leftheight = $('.left').height();
		//alert(funHeight+'/'+containHeight);
		if(rightheight > leftheight)
			$('.left').height(rightheight);
		else
			$('.right').height(leftheight);
    });
}





